package com.ler.nacosdubbo.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.ler.nacosdubbo.domain.User;
import com.ler.nacosdubbo.service.UserService;

/**
 * @author lww
 * @date 2019-08-17 15:53
 */
@Service(timeout = 5000)
//@Component 可以使用Spring的@Component注解，来让Spring来管理。因为测试Dubbo不用这个注解
public class UserServiceImpl implements UserService {

	@Override
	public User getUser() {
		User user = new User();
		user.setName("Hello Dubbo,From Nacos!");
		user.setAge(123);
		//try {
		//	Thread.sleep(4000);
		//} catch (InterruptedException e) {
		//	e.printStackTrace();
		//}
		return user;
	}

}
